package top.lunarye.handler.flowControl;

import com.google.common.util.concurrent.RateLimiter;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.lunarye.common.enums.RateLimitStrategy;

/**
 * 流量控制参数
 * @author lunar
 * @since 2022-07-20
 */
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FlowControlParam {

    /**
     * 指定限流器
     */
    protected RateLimiter rateLimiter;

    /**
     * 限流器初始限流大小
     * 子类初始化时指定
     */
    protected Double rateInitValue;

    /**
     * 限流的策略
     * 子类初始化时指定
     */
    protected RateLimitStrategy rateLimitStrategy;
}
